﻿@model mvcForum.Web.ViewModels.ForumViewModel
@using mvcForum.Web.Helpers;
@{
	ViewBag.Title = ForumHelper.GetString("Forum.Title", new { Name = Model.Name });

	Layout = Url.GetThemeBaseUrl() + "areas/forum/views/shared/forumlayout.cshtml";
}
<!-- Views/Forum/Index.cshtml-->
@Html.Partial("Breadcrumb", Model.Path)

	<span class="pull-right muted">@ForumHelper.GetString("CurrentTime", new object[] { DateTime.UtcNow })</span>

	<h2>@Model.Name</h2>
	<hr />
@if (TempData["Feedback"] != null) {
	<ul class="list-unstyled">
	@foreach (var text in (IEnumerable<MvcHtmlString>)TempData["Feedback"]) {
		<li>@text</li>
	}	 
	</ul>
}
		@Html.Partial("ForumButtonsPartial", Model)
		@Html.Partial("ForumPagingPartial", Model.Paging)
	<table class="table">
@if (Model.SubForums.Count() > 0) {
		<thead>
			<tr class="heading">
				<th colspan="2" class="col-md-6">@ForumHelper.GetString("Labels.Forum")</th>
				<th class="col-md-1">@ForumHelper.GetString("Labels.Topics")</th>
				<th class="col-md-1">@ForumHelper.GetString("Labels.Posts")</th>
				<th class="col-md-4">@ForumHelper.GetString("Labels.LastPost")</th>
			</tr>
		</thead>
		<tbody>
@foreach (var forum in Model.SubForums) {
@Html.Partial("ForumPartial", forum)
}
		</tbody>	
}
		<tbody>
			<tr class="heading">
				<td colspan="2">@ForumHelper.GetString("Labels.Topics")</td>
				<td>@ForumHelper.GetString("Labels.Replies")</td>
				<td>@ForumHelper.GetString("Labels.Views")</td>
				<td>@ForumHelper.GetString("Labels.LastPost")</td>
			</tr>
@foreach (var topic in Model.Topics) {
@Html.Partial("TopicPartial", topic)
}
		</tbody>
	</table>
		@Html.Partial("ForumButtonsPartial", Model)
		@Html.Partial("ForumPagingPartial", Model.Paging)
@if (ForumHelper.Debug) {
<!-- For Selenium Test -->
<div id="forum_forum_index" style="display: none;"></div>
}
@Html.Partial("Breadcrumb", Model.Path)
